struct Solution {}

impl Solution {
    pub fn fair_candy_swap(alice_sizes: Vec<i32>, bob_sizes: Vec<i32>) -> Vec<i32> {
        let a = (bob_sizes.iter().sum::<i32>() - alice_sizes.iter().sum::<i32>()) / 2;
        for i in 0..alice_sizes.len() {
            let b = alice_sizes[i] + a;
            if bob_sizes.iter().any(|&x| x == b) {
                let idx = bob_sizes.iter().position(|&x| x == b).unwrap();
                return vec![alice_sizes[i], bob_sizes[idx]];
            }
        }
        let ret = vec![];
        ret
    }
}

fn main() {}